package com.javaee.exam.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.javaee.exam.dao.CategoryMapper;
import com.javaee.exam.pojo.Category;
import com.javaee.exam.service.CategoryService;

@Service
public class CategoryServiceImpl implements CategoryService {

	@Autowired
	private CategoryMapper categoryMapper;

	@Override
	public List<Category> list() {
		return categoryMapper.selectList();
	}

	@Override
	public boolean addCategory(Category category) {
		Integer result = categoryMapper.insert(category);
		return result > 0 ? true : false;
	}

}
